# -*- codeing = utf-8 -*-
# @Time : 2024/3/20 23:13
# @Author : huangjing
# @File : myThread.py
# @Software : PyCharm
import threading,requests,time


urls = {
    "http://www.example.com",
    "http://www.example.org",
    "http://www.example.net"
}
def requestTask(url):
    response = requests.get(url)
    print(f'{threading.current_thread().name} received response for {url}')
start_date = time.time()
threads = [threading.Thread(target=requestTask,args=(url,)) for url in urls]
for i in threads:
    i.start()
for i in threads:
    i.join()
end_date = time.time()
print(f'3个请求总耗时:{end_date-start_date}')